package com.java1223;

public class Java03 {
    public static void main(String[] args) {
        //java语言运算符
        //1.算数运算符
        System.out.println(1+2);
        System.out.println(1-2);
        System.out.println(1*2);
        System.out.println(3/2);//1
        System.out.println(1%2);//a-a/b*b

        //2.比较运算符
        System.out.println(3>2);
        System.out.println(3>=2);
        System.out.println(3<2);
        System.out.println(3<=2);
        System.out.println(3!=2);

        //3.赋值6个
        int a = 2;
        a +=2;
        a -=2;
        a *=2;
        a /=2;
        a %=2;
        //4.逻辑运算符
        System.out.println(true && false);
        System.out.println(false && true);
        System.out.println(true && true);
        System.out.println(false && false);

        System.out.println(true || false);
        System.out.println(false || true);
        System.out.println(true || true);
        System.out.println(false || false);

        System.out.println(!true);
        System.out.println(!false);
        //5.自增自减
        int k=2;
        System.out.println(k++);
        System.out.println(++k);
        //6.三目运算符
        int v1 = 2;
        int v2 = 3;
        System.out.println(v1>v2?v1:v2);
    }
}
